Integrand size = 14, antiderivative size = 50 \[ \int \frac {1}{a+b \tan ^2(e+f x)} \, dx=\frac {x}{a-b}-\frac {\sqrt {b} \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{\sqrt {a} (a-b) f} \]
Time = 0.09 (sec) , antiderivative size = 49, normalized size of antiderivative = 0.98 \[ \int \frac {1}{a+b \tan ^2(e+f x)} \, dx=\frac {\arctan (\tan (e+f x))-\frac {\sqrt {b} \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{\sqrt {a}}}{a f-b f} \]
(ArcTan[Tan[e + f*x]] - (Sqrt[b]*ArcTan[(Sqrt[b]*Tan[e + f*x])/Sqrt[a]])/S qrt[a])/(a*f - b*f)
Time = 0.31 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {3042, 4143, 3042, 4158, 218}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {1}{a+b \tan ^2(e+f x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{a+b \tan (e+f x)^2}dx\) |
\(\Big \downarrow \) 4143 |
\(\displaystyle \frac {x}{a-b}-\frac {b \int \frac {\sec ^2(e+f x)}{b \tan ^2(e+f x)+a}dx}{a-b}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {x}{a-b}-\frac {b \int \frac {\sec (e+f x)^2}{b \tan (e+f x)^2+a}dx}{a-b}\) |
\(\Big \downarrow \) 4158 |
\(\displaystyle \frac {x}{a-b}-\frac {b \int \frac {1}{b \tan ^2(e+f x)+a}d\tan (e+f x)}{f (a-b)}\) |
\(\Big \downarrow \) 218 |
\(\displaystyle \frac {x}{a-b}-\frac {\sqrt {b} \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{\sqrt {a} f (a-b)}\) |
3.1.64.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(-1), x_Symbol] :> Simp[x/(a - b), x] - Simp[b/(a - b) Int[Sec[e + f*x]^2/(a + b*Tan[e + f*x]^2), x], x ] /; FreeQ[{a, b, e, f}, x] && NeQ[a, b]
Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_ )])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Sim p[ff/(c^(m - 1)*f) Subst[Int[(c^2 + ff^2*x^2)^(m/2 - 1)*(a + b*(ff*x)^n)^ p, x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && I ntegerQ[m/2] && (IntegersQ[n, p] || IGtQ[m, 0] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])
Time = 0.07 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.00
method | result | size |
derivativedivides | \(\frac {-\frac {b \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {a b}}\right )}{\left (a -b \right ) \sqrt {a b}}+\frac {\arctan \left (\tan \left (f x +e \right )\right )}{a -b}}{f}\) | \(50\) |
default | \(\frac {-\frac {b \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {a b}}\right )}{\left (a -b \right ) \sqrt {a b}}+\frac {\arctan \left (\tan \left (f x +e \right )\right )}{a -b}}{f}\) | \(50\) |
risch | \(\frac {x}{a -b}+\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {-a b}+a +b}{a -b}\right )}{2 a \left (a -b \right ) f}-\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {-a b}-a -b}{a -b}\right )}{2 a \left (a -b \right ) f}\) | \(120\) |
Time = 0.29 (sec) , antiderivative size = 182, normalized size of antiderivative = 3.64 \[ \int \frac {1}{a+b \tan ^2(e+f x)} \, dx=\left [\frac {4 \, f x - \sqrt {-\frac {b}{a}} \log \left (\frac {b^{2} \tan \left (f x + e\right )^{4} - 6 \, a b \tan \left (f x + e\right )^{2} + a^{2} + 4 \, {\left (a b \tan \left (f x + e\right )^{3} - a^{2} \tan \left (f x + e\right )\right )} \sqrt {-\frac {b}{a}}}{b^{2} \tan \left (f x + e\right )^{4} + 2 \, a b \tan \left (f x + e\right )^{2} + a^{2}}\right )}{4 \, {\left (a - b\right )} f}, \frac {2 \, f x - \sqrt {\frac {b}{a}} \arctan \left (\frac {{\left (b \tan \left (f x + e\right )^{2} - a\right )} \sqrt {\frac {b}{a}}}{2 \, b \tan \left (f x + e\right )}\right )}{2 \, {\left (a - b\right )} f}\right ] \]
[1/4*(4*f*x - sqrt(-b/a)*log((b^2*tan(f*x + e)^4 - 6*a*b*tan(f*x + e)^2 + a^2 + 4*(a*b*tan(f*x + e)^3 - a^2*tan(f*x + e))*sqrt(-b/a))/(b^2*tan(f*x + e)^4 + 2*a*b*tan(f*x + e)^2 + a^2)))/((a - b)*f), 1/2*(2*f*x - sqrt(b/a)* arctan(1/2*(b*tan(f*x + e)^2 - a)*sqrt(b/a)/(b*tan(f*x + e))))/((a - b)*f) ]
Leaf count of result is larger than twice the leaf count of optimal. 240 vs. \(2 (37) = 74\).
Time = 1.25 (sec) , antiderivative size = 240, normalized size of antiderivative = 4.80 \[ \int \frac {1}{a+b \tan ^2(e+f x)} \, dx=\begin {cases} \frac {\tilde {\infty } x}{\tan ^{2}{\left (e \right )}} & \text {for}\: a = 0 \wedge b = 0 \wedge f = 0 \\\frac {x}{a} & \text {for}\: b = 0 \\\frac {- x - \frac {1}{f \tan {\left (e + f x \right )}}}{b} & \text {for}\: a = 0 \\\frac {f x \tan ^{2}{\left (e + f x \right )}}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} + \frac {f x}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} + \frac {\tan {\left (e + f x \right )}}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} & \text {for}\: a = b \\\frac {x}{a + b \tan ^{2}{\left (e \right )}} & \text {for}\: f = 0 \\\frac {2 f x \sqrt {- \frac {a}{b}}}{2 a f \sqrt {- \frac {a}{b}} - 2 b f \sqrt {- \frac {a}{b}}} - \frac {\log {\left (- \sqrt {- \frac {a}{b}} + \tan {\left (e + f x \right )} \right )}}{2 a f \sqrt {- \frac {a}{b}} - 2 b f \sqrt {- \frac {a}{b}}} + \frac {\log {\left (\sqrt {- \frac {a}{b}} + \tan {\left (e + f x \right )} \right )}}{2 a f \sqrt {- \frac {a}{b}} - 2 b f \sqrt {- \frac {a}{b}}} & \text {otherwise} \end {cases} \]
Piecewise((zoo*x/tan(e)**2, Eq(a, 0) & Eq(b, 0) & Eq(f, 0)), (x/a, Eq(b, 0 )), ((-x - 1/(f*tan(e + f*x)))/b, Eq(a, 0)), (f*x*tan(e + f*x)**2/(2*b*f*t an(e + f*x)**2 + 2*b*f) + f*x/(2*b*f*tan(e + f*x)**2 + 2*b*f) + tan(e + f* x)/(2*b*f*tan(e + f*x)**2 + 2*b*f), Eq(a, b)), (x/(a + b*tan(e)**2), Eq(f, 0)), (2*f*x*sqrt(-a/b)/(2*a*f*sqrt(-a/b) - 2*b*f*sqrt(-a/b)) - log(-sqrt( -a/b) + tan(e + f*x))/(2*a*f*sqrt(-a/b) - 2*b*f*sqrt(-a/b)) + log(sqrt(-a/ b) + tan(e + f*x))/(2*a*f*sqrt(-a/b) - 2*b*f*sqrt(-a/b)), True))
Time = 0.30 (sec) , antiderivative size = 48, normalized size of antiderivative = 0.96 \[ \int \frac {1}{a+b \tan ^2(e+f x)} \, dx=-\frac {\frac {b \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b}}\right )}{\sqrt {a b} {\left (a - b\right )}} - \frac {f x + e}{a - b}}{f} \]
Time = 0.40 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.30 \[ \int \frac {1}{a+b \tan ^2(e+f x)} \, dx=-\frac {\frac {{\left (\pi \left \lfloor \frac {f x + e}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (b\right ) + \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b}}\right )\right )} b}{\sqrt {a b} {\left (a - b\right )}} - \frac {f x + e}{a - b}}{f} \]
-((pi*floor((f*x + e)/pi + 1/2)*sgn(b) + arctan(b*tan(f*x + e)/sqrt(a*b))) *b/(sqrt(a*b)*(a - b)) - (f*x + e)/(a - b))/f
Time = 10.87 (sec) , antiderivative size = 948, normalized size of antiderivative = 18.96 \[ \int \frac {1}{a+b \tan ^2(e+f x)} \, dx=-\frac {\mathrm {atan}\left (\frac {\frac {-4\,b^3\,\mathrm {tan}\left (e+f\,x\right )+\frac {\left (4\,b^4-8\,a\,b^3+4\,a^2\,b^2+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (-8\,a^3\,b^2+8\,a^2\,b^3+8\,a\,b^4-8\,b^5\right )\,1{}\mathrm {i}}{2\,a-2\,b}\right )\,1{}\mathrm {i}}{2\,a-2\,b}}{2\,a-2\,b}+\frac {-4\,b^3\,\mathrm {tan}\left (e+f\,x\right )+\frac {\left (8\,a\,b^3-4\,b^4-4\,a^2\,b^2+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (-8\,a^3\,b^2+8\,a^2\,b^3+8\,a\,b^4-8\,b^5\right )\,1{}\mathrm {i}}{2\,a-2\,b}\right )\,1{}\mathrm {i}}{2\,a-2\,b}}{2\,a-2\,b}}{\frac {\left (-4\,b^3\,\mathrm {tan}\left (e+f\,x\right )+\frac {\left (4\,b^4-8\,a\,b^3+4\,a^2\,b^2+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (-8\,a^3\,b^2+8\,a^2\,b^3+8\,a\,b^4-8\,b^5\right )\,1{}\mathrm {i}}{2\,a-2\,b}\right )\,1{}\mathrm {i}}{2\,a-2\,b}\right )\,1{}\mathrm {i}}{2\,a-2\,b}-\frac {\left (-4\,b^3\,\mathrm {tan}\left (e+f\,x\right )+\frac {\left (8\,a\,b^3-4\,b^4-4\,a^2\,b^2+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (-8\,a^3\,b^2+8\,a^2\,b^3+8\,a\,b^4-8\,b^5\right )\,1{}\mathrm {i}}{2\,a-2\,b}\right )\,1{}\mathrm {i}}{2\,a-2\,b}\right )\,1{}\mathrm {i}}{2\,a-2\,b}}\right )}{f\,\left (a-b\right )}+\frac {\mathrm {atan}\left (\frac {\frac {\sqrt {-a\,b}\,\left (2\,b^3\,\mathrm {tan}\left (e+f\,x\right )-\frac {\sqrt {-a\,b}\,\left (2\,b^4-4\,a\,b^3+2\,a^2\,b^2+\frac {\mathrm {tan}\left (e+f\,x\right )\,\sqrt {-a\,b}\,\left (-8\,a^3\,b^2+8\,a^2\,b^3+8\,a\,b^4-8\,b^5\right )}{4\,\left (a\,b-a^2\right )}\right )}{2\,\left (a\,b-a^2\right )}\right )\,1{}\mathrm {i}}{a\,b-a^2}+\frac {\sqrt {-a\,b}\,\left (2\,b^3\,\mathrm {tan}\left (e+f\,x\right )-\frac {\sqrt {-a\,b}\,\left (4\,a\,b^3-2\,b^4-2\,a^2\,b^2+\frac {\mathrm {tan}\left (e+f\,x\right )\,\sqrt {-a\,b}\,\left (-8\,a^3\,b^2+8\,a^2\,b^3+8\,a\,b^4-8\,b^5\right )}{4\,\left (a\,b-a^2\right )}\right )}{2\,\left (a\,b-a^2\right )}\right )\,1{}\mathrm {i}}{a\,b-a^2}}{\frac {\sqrt {-a\,b}\,\left (2\,b^3\,\mathrm {tan}\left (e+f\,x\right )-\frac {\sqrt {-a\,b}\,\left (2\,b^4-4\,a\,b^3+2\,a^2\,b^2+\frac {\mathrm {tan}\left (e+f\,x\right )\,\sqrt {-a\,b}\,\left (-8\,a^3\,b^2+8\,a^2\,b^3+8\,a\,b^4-8\,b^5\right )}{4\,\left (a\,b-a^2\right )}\right )}{2\,\left (a\,b-a^2\right )}\right )}{a\,b-a^2}-\frac {\sqrt {-a\,b}\,\left (2\,b^3\,\mathrm {tan}\left (e+f\,x\right )-\frac {\sqrt {-a\,b}\,\left (4\,a\,b^3-2\,b^4-2\,a^2\,b^2+\frac {\mathrm {tan}\left (e+f\,x\right )\,\sqrt {-a\,b}\,\left (-8\,a^3\,b^2+8\,a^2\,b^3+8\,a\,b^4-8\,b^5\right )}{4\,\left (a\,b-a^2\right )}\right )}{2\,\left (a\,b-a^2\right )}\right )}{a\,b-a^2}}\right )\,\sqrt {-a\,b}\,1{}\mathrm {i}}{a\,f\,\left (a-b\right )} \]
(atan((((-a*b)^(1/2)*(2*b^3*tan(e + f*x) - ((-a*b)^(1/2)*(2*b^4 - 4*a*b^3 + 2*a^2*b^2 + (tan(e + f*x)*(-a*b)^(1/2)*(8*a*b^4 - 8*b^5 + 8*a^2*b^3 - 8* a^3*b^2))/(4*(a*b - a^2))))/(2*(a*b - a^2)))*1i)/(a*b - a^2) + ((-a*b)^(1/ 2)*(2*b^3*tan(e + f*x) - ((-a*b)^(1/2)*(4*a*b^3 - 2*b^4 - 2*a^2*b^2 + (tan (e + f*x)*(-a*b)^(1/2)*(8*a*b^4 - 8*b^5 + 8*a^2*b^3 - 8*a^3*b^2))/(4*(a*b - a^2))))/(2*(a*b - a^2)))*1i)/(a*b - a^2))/(((-a*b)^(1/2)*(2*b^3*tan(e + f*x) - ((-a*b)^(1/2)*(2*b^4 - 4*a*b^3 + 2*a^2*b^2 + (tan(e + f*x)*(-a*b)^( 1/2)*(8*a*b^4 - 8*b^5 + 8*a^2*b^3 - 8*a^3*b^2))/(4*(a*b - a^2))))/(2*(a*b - a^2))))/(a*b - a^2) - ((-a*b)^(1/2)*(2*b^3*tan(e + f*x) - ((-a*b)^(1/2)* (4*a*b^3 - 2*b^4 - 2*a^2*b^2 + (tan(e + f*x)*(-a*b)^(1/2)*(8*a*b^4 - 8*b^5 + 8*a^2*b^3 - 8*a^3*b^2))/(4*(a*b - a^2))))/(2*(a*b - a^2))))/(a*b - a^2) ))*(-a*b)^(1/2)*1i)/(a*f*(a - b)) - atan(((((4*b^4 - 8*a*b^3 + 4*a^2*b^2 + (tan(e + f*x)*(8*a*b^4 - 8*b^5 + 8*a^2*b^3 - 8*a^3*b^2)*1i)/(2*a - 2*b))* 1i)/(2*a - 2*b) - 4*b^3*tan(e + f*x))/(2*a - 2*b) + (((8*a*b^3 - 4*b^4 - 4 *a^2*b^2 + (tan(e + f*x)*(8*a*b^4 - 8*b^5 + 8*a^2*b^3 - 8*a^3*b^2)*1i)/(2* a - 2*b))*1i)/(2*a - 2*b) - 4*b^3*tan(e + f*x))/(2*a - 2*b))/(((((4*b^4 - 8*a*b^3 + 4*a^2*b^2 + (tan(e + f*x)*(8*a*b^4 - 8*b^5 + 8*a^2*b^3 - 8*a^3*b ^2)*1i)/(2*a - 2*b))*1i)/(2*a - 2*b) - 4*b^3*tan(e + f*x))*1i)/(2*a - 2*b) - ((((8*a*b^3 - 4*b^4 - 4*a^2*b^2 + (tan(e + f*x)*(8*a*b^4 - 8*b^5 + 8*a^ 2*b^3 - 8*a^3*b^2)*1i)/(2*a - 2*b))*1i)/(2*a - 2*b) - 4*b^3*tan(e + f*x...